<?php

/**
 * Movie form base class.
 *
 * @package    phpmymovies
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseMovieForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'          => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInput(),
      'releasedate' => new sfWidgetFormDate(),
      'genre'       => new sfWidgetFormInput(),
      'plot'        => new sfWidgetFormTextarea(),
      'time'        => new sfWidgetFormInput(),
      'company'     => new sfWidgetFormInput(),
      'poster'      => new sfWidgetFormInput(),
      'medium_id'   => new sfWidgetFormPropelChoice(array('model' => 'Medium', 'add_empty' => true)),
      'site_id'     => new sfWidgetFormPropelChoice(array('model' => 'Site', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'          => new sfValidatorPropelChoice(array('model' => 'Movie', 'column' => 'id', 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 100)),
      'releasedate' => new sfValidatorDate(array('required' => false)),
      'genre'       => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'plot'        => new sfValidatorString(array('required' => false)),
      'time'        => new sfValidatorInteger(array('required' => false)),
      'company'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'poster'      => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'medium_id'   => new sfValidatorPropelChoice(array('model' => 'Medium', 'column' => 'id', 'required' => false)),
      'site_id'     => new sfValidatorPropelChoice(array('model' => 'Site', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('movie[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Movie';
  }


}
